<!DOCTYPE html>
<html>
<head>
<title>Pragprog Books Online Store</title>
<%= stylesheet_link_tag "application", media: "all","data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body class="<%= controller.controller_name %>">
<div id="banner">
<%= image_tag("logo.png") %>
<%= @page_title || "Pragmatic Bookshelf" %>
<%= link_to "注册",signup_path,class: "lp" %>
<%= link_to "登录", login_path ,class: "lp" %>
</div>
<div id="columns">
<div id="side">
      <div id="cart">
      <% if @cart %>
      <%= hidden_div_if(@cart.line_items.empty?, id: 'cart') do %>
      <%= render @cart %>
      <% end %>
      <% end %>
      </div>
<ul>
<li><%= link_to "主页",root_path %></li>
</ul>

<% if session[:user_id] %>
<ul>
<li><%= link_to '订单',
orders_path
%></li>
<li><%= link_to '商品', products_path %></li>
<li><%= link_to '用户',
users_path
%></li>
</ul>
<%= button_to '登出', logout_path, method: :delete %>
<% end %>

</div>
<div id="main">
<%= yield %>
</div>
</div>
</body>
</html>